<%--
  Created by IntelliJ IDEA.
  User: z'y'l
  Date: 2021/6/30
  Time: 9:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=utf-8" import="java.sql.*"%>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加学生信息</title>
</head>
<base href="<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>">
<link href="bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="bootstrap-3.3.7-dist/jquery-3.2.1.min.js" ></script>
<script type="text/javascript" src="bootstrap-3.3.7-dist/js/bootstrap.js"></script>
<script type="text/javascript" src="bootstrap-3.3.7-dist/js/npm.js"></script>
<style>
    .container {
        height: 110%;
        width: 100%;
        position: relative;
        background: url("img/cong.jpg") no-repeat;
    }

    .login {
        width: 500px;
        height: auto;
        background-color: white;
        position: absolute;
        left: 450px;
        border-radius: 8px;
    }

    label {
        float: left;
        width: 100px;
        margin-top: 7px;
        margin-right: 5px;
    }

    .form-control {
        width: 60%;
    }

    .logtip {
        padding-top: 20px;
        padding-bottom: 20px;
        border-bottom: 2px solid red;
        text-align: center;
    }

    .form-group {
        margin-left: 40px;
        margin-top: 20px;
    }

    .btn {
        height: 50px;
        width: 100px;
        float: left;
        border-radius: 10px;
    }

    .btnbag {
        margin-left: 200px;
        margin-right: 200px;
        height: 50px;
        overflow: hidden;
        margin-top: 30px;
        margin-bottom: 40px;
    }
</style>
<body>

<div class="container">
    <div class="login">
        <h2 class="logtip">学生信息</h2>
        <form action="/user/addxs" method="post" onsubmit="return check()" accept-charset="UTF-8">
            <div class="form-group">
                <label for="sno">用户ID</label>
                <input type="text" class="form-control" id="sno" name="sno">
            </div>

            <div class="form-group">
                <label for="nickname">用户名</label>
                <input type="text" class="form-control" id="nickname" name="nickname">
            </div>

            <div class="form-group">
                <label for="pass">用户密码</label>
                <input type="password" class="form-control" id="pass" name="pass">
            </div>

            <div class="form-group">
                <label for="sname">用户姓名</label>
                <input type="text" class="form-control" id="sname" name="sname">
            </div>
            <div class="form-group">
                <label for="ssex">用户性别</label>
                <select name="ssex" id="ssex"  class="form-control" >
                    <option value="">--请选择--</option>
                    <option value="男">男</option>
                    <option value="女">女</option>
                 </select>
            </div>
            <div class="form-group">
                <label for="age">用户年龄</label>
                <input type="text" class="form-control" id="age" name="age">
            </div>

            <div class="form-group">
                <label for="tel">用户手机号</label>
                <input type="text" class="form-control" id="tel" name="tel">
            </div>

            <div class="form-group">
                <label for="email">用户邮箱</label>
                <input type="text" class="form-control" id="email" name="email">
            </div>

            <div class="form-group">
                <label for="job">用户职业</label>
                <input type="text" class="form-control" id="job" name="job">
            </div>

            <div class="form-group">
                <label for="address">用户地址</label>
                <input type="text" class="form-control" id="address" name="address">
            </div>

            <div class="form-group">
                <label for="state">用户状态</label>
                <input type="text" class="form-control" id="state" name="state">
            </div>

            <div class="form-group">
                <label>用户头像</label>
                <input type="file" id="previewimg">
            </div>
            <div class="btnbag">
                <input type="submit" class="btn btn-primary logbtn" value="确定">
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript">
    function check() {
        var sno = document.getElementById("sno").value;
        var sname = document.getElementById("sname").value;
        if ((sno == "") || (sname == "")) {
            alert("学号/姓名必填!");
            return false;
        }
        return true;
    }
</script>
</html>

